import { BroadCastCall } from "../../broadCast/BroadCastCall";
import { MessageBlock } from "../../../../../Framework/MQ/MessageBlock";
import { SPublicMiniPlayer } from "../../../../../Message/Public/SPublicMiniPlayer";
import { MsgManager } from "../../../manager/MsgManager";
import { Language } from "../../../../../extend/language/Language";
import { NetDispatcher } from "../../../../mvc/core/NetDispatcher";
import { ServerCommand } from "../../../mvc/ServerCommand";
//class GroupEntityInfoCommand
    
    export  class GroupEntityInfoCommand extends BroadCastCall
    {
        constructor(arg1: Object)
        {
            super(arg1);
            return;
        }

        public /* override */ call(arg1: MessageBlock): void
        {
            var loc6=null;
            super.call(arg1);
            var loc1=arg1.messageBase as SPublicMiniPlayer;
            var loc2=_cache.group.players;
            var loc3=loc2.length;
            var loc4=false;
            var loc5=0;
            while (loc5 < loc3) 
            {
                if ((loc6 = loc2[loc5] as SPublicMiniPlayer).entityId.id == loc1.entityId.id) 
                {
                    loc2[loc5] = loc1;
                    loc4 = true;
                    break;
                }
                ++loc5;
            }
            if (!loc4) 
            {
                loc2.push(loc1);
                MsgManager.showRollTipsMsg(Language.getStringByParam(62029, loc1.name));
            }
            NetDispatcher.dispatchCmd(ServerCommand.Group_PlayerInfoChange, _cache.group.players);
            return;
        }
    }
